package iterator;/** * Created by Administrator on 2018-10-29. */public class NewDinerMenueIterator implements Iterator {    MenuItem[] items;    int position = 0;    public NewDinerMenueIterator(MenuItem[] items){       this.items = items;    }    public boolean hasNext() {        if(position>=items.length ||items[position]==null){            return false;        }else {            return true;        }    }    public Object next() {        MenuItem menuItem = items[position];        position = position +1;        return menuItem;    }}